#include "widget.h"
#include "ui_widget.h"
#include <dialog_login.h>
#include <dialog_register.h>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::paintEvent(QPaintEvent *event)
{
    static int pos=0;
    QString picture[1]={":/new/prefix1/R-C.jpg"};

    //对象
    QPainter* painter=new QPainter(this);

    // 画图
    QPixmap pixmap;
    pixmap.load(picture[pos]);
    //pixmap.scaled(800,600);//控件大小
    painter->drawPixmap(0,0,800,600,pixmap);//图片大小

}


//void Widget::on_btn_login_clicked()
//{
//    Dialog_Login *dlg = new Dialog_Login;
//    if(dlg->exec()==QDialog::Accepted)
//    {
//        ui->label->setText("已登录");
//    }
//}

//void Widget::on_btn_register_clicked()
//{
//    Dialog_Register *dlg = new Dialog_Register;
//    if(dlg->exec()==QDialog::Accepted)
//    {
//        ui->label->setText("注册成功");
//    }
//}
